import request from '@/utils/request'

export function getRoleListAPI(params) {
    return request({
        url: '/park/sys/role',
        params
    })
}
export function getTreeListAPI() {
    return request({
        url: '/park/sys/permision/all/tree',
        method:'GET'
    })
}
export function getRoleDetailAPI(id) {
    return request({
        url: '/park/sys/role/' + id,
        method:'GET'
    })
}

export function getRoleUserAPI(id){
    return request({
        url: '/park/sys/roleUser/' + id,
        method:'GET'
    })
}

export function createRoleUserAPI(data) {
    return request({
        url: `/park/sys/role`,
        method: 'POST',
        data
    })
}

export function updateRoleAPI(data) {
    return request({
        url: `/park/sys/role`,
        method: 'PUT',
        data
    })
}

export function delRoleUserAPI(id) {
    return request({
        url: '/park/sys/role/' + id,
        method: 'DELETE'
    })
}